package shoooter.entity.bonus;

import java.awt.*;
import java.util.*;
import shoooter.GameState;
import shoooter.entity.BasicGameEntity;


public class Bonus extends BasicGameEntity {

    Color c = null;
    public int h = 20;
    public int w = 13;
    public int elapsed_time = 0;
    public int elapsed_limit = 0;
    int type;
    
    Random rand = new Random();
    
    GameState g;

    public boolean taken = false;

    public static final int FAST = 0, SHIELD = 1, BOMB = 2;

    Bonus() {
        
    }

    public boolean isActive() {
        return (elapsed_time < elapsed_limit);
    }

    public void draw(Graphics2D g2d) {
        g2d.setColor(Color.CYAN);
        g2d.drawOval((int)this.getX()-w/2, (int)this.getY()-h/2, w, h);
    }

    public boolean elapse() {
        elapsed_time++;
        if(elapsed_time >= elapsed_limit) {
            unapply();
            return false;
        }    
        return true;
    }

    public void take() {
        taken = true;
        apply();
    }

    public int getType() {
        return this.type;
    }

    void apply() {}
    void unapply() {}

}